/**
 * 用户信息 context
 * */

import React from 'react';

// 登录后获取的用户信息
export interface IUser {
  userName: string;
  token: string;
  userId: string;
}

export const defaultUser: IUser = {
  userName: '',
  token: '',
  userId: '',
};
const GlobalContext = React.createContext({
  user: defaultUser,
  emitter: {
    on: (a: any, b: any) => {},
    off: (a: any, b: any) => {},
    emit: (a: any, b: any) => {},
  },
  setUser: (user: IUser) => {},
  dictionary: {},
});
export default GlobalContext;
